Skip to content

Fix common parameters for PowerShell 7.4.0. #611

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

homotechsual
Copy link

PR Summary

This PR adds handling and test coverage for the new -ProgressAction common parameter introduced with PowerShell 7.4.0.

PR Context

Fixes issue #595 see this issue for further detail.

@homotechsual
Copy link
Author

@microsoft-github-policy-service agree

@@ -2542,7 +2542,8 @@ function ConvertPsObjectsToMamlModel
'InformationVariable',
'OutVariable',
'OutBuffer',
'PipelineVariable'
'PipelineVariable',
'ProgressAction'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole section could be replaced with: [System.Management.Automation.PSCmdlet]::CommonParameters that way we can avoid this problem in the future.
In the other sections where it's written out in a string you could do something like: [System.Management.Automation.PSCmdlet]::CommonParameters | foreach -Begin {$Res = ""} -Process {$Res+= "-$_, "} -End {$Res.Trim(', ')}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree that this is the best way to solve for all.

@fflaten
Copy link

fflaten commented Nov 17, 2024

@sdwheeler Could we get a minor release with this soon? Moving to CommonParameters sounds like a v2 improvement 🙂 Just need to fix our broken docs for now.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants